/*
 * 数据看板
 *   - 财务报表 API
 * */

import request from "@/utils/request";

export function remainIndex({start_time, end_time}, {page, page_size}) {
  return request({
    url: "/remain/index",
    params: {
      start_time,
      end_time,
      page,
      page_size
    }
  });
}

export function getExport({start_time, end_time}) {
  return request({
    url: "/remain/export_xls",
    method: "get",
    params: {
      start_time,
      end_time
    }
  });
}


export function statisticCate() {
  return request({
    url: "/statistic/cate",
    method: "get"
  });
}


export function statisticKeepMallcate(page, start_time, end_time) {
  return request({
    url: "/statistic/keep/mallcate",
    method: "get",
    params: {page, start_time, end_time}
  });
}


export function statisticKeepGameExcel(type, start_time, end_time) {
  return request({
    url: "/statistic/keep/game/excel",
    params: {type, start_time, end_time}
  })
}


export function statisticKeepGame(page, type, start_time, end_time) {
  return request({
    url: "/statistic/keep/game",
    method: "get",
    params: {page, type, start_time, end_time}
  });
}

export function statisticKeepMallcateExcel(start_time, end_time) {
  return request({
    url: "/statistic/keep/mallcate/excel",
    params: {start_time, end_time}
  })
}


/*
* 数据看板-商城流水 - 商城流水统计
* */
export function statisticsMallSerialTotal() {
  return request({
    url: "/statistics/mall-serial/total"
  })
}

/*
* 数据看板-房间流水 - 房间流水统计
* */
export function statisticsRoomSerialTotal() {
  return request({
    url: "/statistics/room-serial/total"
  })
}

/*
* 数据看板-房间流水 - 房间流水列表
* */
export function statisticsRoomSerial({
                                       date_tag,
                                       start_date,
                                       end_date,
                                       room_id
                                     }, {
                                       page,
                                       page_size
                                     }, {
                                       order_by_room_gift,
                                       order_by_blind_box,
                                       order_by_lucky_tree,
                                       order_by_scramble_sugar,
                                       order_by_huoke
                                     }) {
  return request({
    url: "/statistics/room-serial",
    params: {
      date_tag,
      start_date,
      end_date,
      room_id,
      page,
      page_size,
      order_by_room_gift,
      order_by_blind_box,
      order_by_lucky_tree,
      order_by_scramble_sugar,
      order_by_huoke
    }
  })
}


/*
* 数据看板-房间流水 - 刷新系统流水数据
* */
export function refresh() {
  return request({
    url: "/statistics/room-serial/refresh"
  })
}
